<template>
  <div class="bigbox">
      <div class="content_content1_hang_cell" v-for="(item,index) in list" :key="index">
          <div  @click="skip(item)">


        <div><img :src="item.coverFileUrl"></div>
        <div>{{item.courseTitle}}</div>
        <div class="detail">共{{item.subSectionNum}}节课|{{item.participationsCount}}人报名</div>
        <div v-if="item.isFree=='0'">
            <span style="font-size: 16px;color: #ff4500;margin-right:4px">￥{{item.coursePrice}}</span>
            <del style="font-size: 12px;color: #999">￥{{item.discountPrice}}</del>
            <span class="juhui">{{item.discountDesc}}</span>
        </div>
        <div class="free" v-if="item.isFree=='1'">免费</div>
          </div>
     </div>
  </div>
</template>

<script>
export default {
    props:{
        type:String,
        pageSize:Number
    },
    data(){
        return{
            list:[]
        }
    },
    created(){
        const url=new URLSearchParams()
        url.append("type",this.type)
        url.append("pageNum",1)
        url.append("pageSize",this.pageSize)
        this.$axios.post("http://59.111.104.104:8086/weChat/applet/course/list/type",url).then(res=>{
            this.list=res.data.rows
        });
    },
    methods:{
        skip(item){
            this.$router.push({
                path:`/detail/${item.courseId}`,
            })
        }
    }
}
</script>

<style lang='less' scoped>
.bigbox{
    display: flex;
    justify-content: space-around;
    flex-wrap:wrap
}
.content_content1_hang_cell{
    margin-top: 10px;
    width: 20%;
    box-sizing: border-box;
    padding: 5px;
    text-align: left;
    img{
        width: 100%;
    }
}

.detail{
    color: #888;
}
.free{
    color: #00CF8C;
    font-size: 16px;
}
.juhui{
    border: 1px solid #FFD591;
    background-color: #FFF7E6;
    color: #FA8C16;
    /* padding: 5px; */
    width: 58px;
    font-size: 13px;
    height: 18px;
    text-align: center;
    line-height: 18px;
    margin: 0px 9px;
    border-radius: 2px;
    float: right;
}
img{
    height: 145px;
    width: 240px;
}
</style>